require.config({
  urlArgs: "version=20170407",
  paths: {
    'jquery': '/js/packages/jquery-2.14-min',
    'bootstrap': '/bootstrap/js/bootstrap.min',
    'bootstrapdate': '/bootstrap/bootstrap-date/js/bootstrap-datetimepicker.min',
    
  },
  shim: {
    'bootstrap': {
      deps: ['jquery'],
      exports: 'bootstrap'
    },
  	'bootstrapdate':{
  		deps: ['jquery'],
        exports: 'bootstrap'
  	}
  }
  
});

require(['jquery','bootstrap','bootstrapdate'], function ($) {
	//alert('hello deep')
	var myChart = echarts.init(document.getElementById('graph-content'));
	$('#graph-7001').click(function () {
	  	drawGraph_7001();
	  });
	  $('#graph-7002').click(function () {
	  	drawGraph_7002();
	  });
	  $('#graph-7003').click(function () {
		  	drawGraph_7003();
	  });

	  function drawGraph_7001() {
			/*$.ajaxSetup({async:false});

			var figdata;
			$.get("/draw/graph/7001",function(data,status){figdata = data;});*/

			
			$.ajax({
				type : 'GET',
				url : '/draw/graph/7001',
				//data : jsonda,
				cache: false,
				async:false,
				//contentType: "application/json; charset=utf-8",
				dataType : 'json',
				success : function(data,status) {
					figdata = data;
				},
				error : function(xml, err, throwInfo) {					
					console.log("数据为空或数据错误");
				}
				});
			myChart.clear();		
			/*if((figdata.xlabel.length<=2) && (figdata.ylabel.length<=2)){
				alert("技术特征和技术功效均为空");
			}else if((figdata.ylabel.length<=2)){
				alert("技术特征为空");
			}else if((figdata.xlabel.length<=2)){
				alert("技术功效为空");
			}*/
			
		
		option = {
				/*backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
			        offset: 0,
			        color: '#f7f8fa'
			    }, {
			        offset: 1,
			        color: '#cdd0d5'
			    }]),*/		
		    title: {
		        text: ''//'专利技术特征功效矩阵'
		    },
		    
		    /*tooltip : {
		        trigger: 'axis',
		        axisPointer: {
		            type: 'cross',
		            label: {
		                backgroundColor: '#6a7985',
		                formatter: function (params) {
		                    // 假设此轴的 type 为 'time'。
		                    return params.data;
		                }
		            }
		        },
		        formatter: function (params) {
	            // 假设此轴的 type 为 'time'。
	            return "";
	        }
		    },*/
		    toolbox: {
		        feature: {
		            saveAsImage: {},    
		        }
		    },
		    xAxis: {
		    	type:'category',
		    	name: '技术功效',
		    	nameLocation:'end',
		    	boundaryGap : false,
		    	data:figdata.xlabel,
		        splitLine: {
		        	show:true,
		            lineStyle: {
		                type: 'dashed'
		            }
		        },
		        axisLabel :{  
		            interval:0,
		            formatter: function (param) {  
	                
		               	 params=param;
		               	 var newParamsName = "";
		               	    var paramsNameNumber = params.length;
		               	    var provideNumber = 0;
		               	    var moreThan = 0;
		               	    if(paramsNameNumber>8){
		               	    	//moreThan=1;
		               	    	var tmpstr="";
		               	    	tmpstr += params.substring(0, 4);
		               	    	tmpstr += "\n";
		               	    	tmpstr += params.substring(4, 8);
		               	    	tmpstr += "...";
		               	    	return tmpstr;
		               	    }else if(paramsNameNumber>4){
		               	    	provideNumber = 4;
		               	    }else if(paramsNameNumber>2){
		               	    	provideNumber = 2;
		               	    }else{
		               	    	provideNumber = 1;
		               	    }
		               	    
		               	    var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
		               	    //
		               	    var start=0;
		               	    var end=0;
		               	    if (paramsNameNumber > provideNumber) {
		               	        /** 循环每一行,p表示行 */ 
		               	        for (var p = 0; p < rowNumber; p++) {
		               	            var tempStr = "";
		               	            //var start = p * provideNumber;// start point
		               	            var start = end;// start point
		               	            var end = start + provideNumber;// end point
		               	            // attention, deal with the last row
		               	            //deal with brackets
		               	            var leftBracketpos=params.substring(start, end).indexOf("(");
		               	            var rightBracketpos=params.substring(start, end).indexOf(")");
		               	            if(leftBracketpos>=0 && rightBracketpos<0){
		               	            	end=params.indexOf(")")+1;
		               	            	if(end==params.length ){
		               	            		rowNumber--;
		               	            	}
		               	            }
		               	            //deal with brackets
		               	            if (p == rowNumber - 1) {

		               	                tempStr = params.substring(start, paramsNameNumber);
		               	            } else {
		               	             
		               	                tempStr = params.substring(start, end) + "\n";
		               	                
		               	            }
		               	            
		               	            	newParamsName += tempStr;// result
		               	            
		               	            
		               	            
		               	        }

		               	    } else {
		               	        newParamsName = params;
		               	    }
		               	    return newParamsName;               	    
		               },
		        },
		      //数据规范化
		        position:'top',
		      //数据规范化
		        
		    },
		    yAxis: {
		    	name: '技术特征',
		    	nameLocation:'start',
		    	type:'category',
		    	 boundaryGap : false,
			    data:figdata.ylabel,
		        splitLine: {
		        	show:true,
		            lineStyle: {
		                type: 'dashed'
		            }
		        },
		        axisLabel :{  
		            interval:0,
		            formatter: function (param) {  
	                
		               	 params=param;
		               	 var newParamsName = "";
		               	    var paramsNameNumber = params.length;
		               	    var provideNumber = 6;
		               	    var moreThan = 0;
		               	    var maxNum = provideNumber*2;
		               	    
		               	    if(paramsNameNumber>maxNum){
		               	    	//moreThan=1;
		               	    	var tmpstr="";
		               	    	tmpstr += params.substring(0, provideNumber);
		               	    	tmpstr += "\n";
		               	    	tmpstr += params.substring(provideNumber, provideNumber*2);
		               	    	tmpstr += "...";
		               	    	return tmpstr;
		               	    }else if(paramsNameNumber<=maxNum && paramsNameNumber>provideNumber){
		               	    	var tmpstr="";
		               	    	tmpstr += params.substring(0, Math.ceil(paramsNameNumber/2));
		               	    	tmpstr += "\n";
		               	    	tmpstr += params.substring(Math.ceil(paramsNameNumber/2), paramsNameNumber);
		               	    	return tmpstr;
		               	    }else{
		               	    	return params;
		               	    }
		               	 
		               },
		        },
		        scale: true
		    },
		    series: [
		    ]
		};
		//alert("figdata.xlabel.length:"+figdata.xlabel.length);
		
		var data = new Array();
		var k;
		var maxcount = 1;
		var maxdiameter = 30;
		var mindiameter = 40-maxdiameter;
		var tmp=0;
		//for(i=0;i<figdata.feaandeffnum[0];i++){
		/*if(figdata.ylabel.length>2){
			
		}*/
		for(i=0;i<figdata.ylabel.length-2;i++){	
			data[i] = new Array();
			
			tmp=i+1;
			eval("k = figdata.value"+tmp+".length");
			for(j=0;j<k;j++){
				//alert("k:"+k);
				var t;
				tmp=i+1;
				eval("t = parseInt(figdata.value"+tmp+"["+j+"])");
				if(t>maxcount) maxcount = t;
				//数据规范化
				data[i][j] = [j+1,i+1,t];
				//数据规范化
			}
		}
	/*//数据规范化
		hotlabelcolor=['#558ED5','#AA4643','#89A544','#71588F','#32cd32','#4198AF','#DB843D','#93A9CF','#D19392','#50B050','#BD9FBD',
			'#32cd32','#40e0d0','#ffd700','#3398DB','#ba55d3',
			'#FF4500','#ff69b4','#cd5c5c','#ffa500','#6495ed',       
			'#1e90ff','#ff6347','#7b68ee','#00fa9a','#da70d6',          
			'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];//#ff6666
			
	*/	//数据规范化
		hotlabelcolor=['#558ED5','#A52A2A','#89A544','#71588F',
		    '#4198AF','#8B4513','#93A9CF','#D19392','#00B050','#A99BBD','#BD9FBD',
		            '#32cd32','#40e0d0','#3398DB','#ba55d3',
		            '#FF4500','#ff69b4','#cd5c5c','#6495ed',
		            '#1e90ff','#ff6347','#7b68ee','#00fa9a','#da70d6',
		            '#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];//,'#ffd700','#ffa500'
		for(var i=0;i<figdata.feaandeffnum[0];i++){
			if(i<10){
				rightColor=9-i;
			}else{
				rightColor=i;
			}
			add={
					
		        data: data[i],
		        type: 'scatter',
		        symbolSize: function (data) {
		        	var sizetm=data[2]/maxcount*maxdiameter;
		        	if(sizetm>0){
		        		sizetm=sizetm+mindiameter;
		        	}
		            return sizetm;
		        },
		       
		        label: {
		        	
		            normal: {
		                show: true,
		                formatter: function (param) {
		                	if(param.data[2]>0)
		                    return param.data[2];
		                	else 
		                		return "";
		                },
		                position: 'right',
		                color:'black',
		                
		            },
		            
		        },
		        itemStyle: { 
		        	normal: {
		                shadowBlur: 10,
		                shadowColor: 'rgba(120, 36, 50, 0.5)',
		                shadowOffsetY: 5,
		                color: hotlabelcolor[rightColor]
		               /* color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
		                    offset: 0,
		                    color: hotlabelcolor[i]
		                }, {
		                    offset: 1,
		                    color: hotlabelcolor[19-i]
		                }])*/
		            }
		        }
		    };	
			option.series.push(add);
		}
	    var m = new Array();
		myChart.on('click', function (param){  
        var name=param.name; 
        var value=figdata.ylabel[param.value[1]];
        var xindex=param.dataIndex;
        var yindex=param.seriesIndex;
        var indexXY="send"+xindex+yindex;
        post_for_patentid_callback(indexXY);            
    }); 
		
		
			myChart.setOption(option);
		}
	  
	  function post_for_patentid_callback(f_graph_message) {
			$.ajax({
				type : 'POST',  
				url : '/draw/graph/7001_callback', 
				//traditional:true,
				data : {
					//'graph_message':JSON.stringify(f_graph_message), 
					'graph_message':f_graph_message,
					'graph_type': "matrix"
				},
		        contentType: "application/x-www-form-urlencoded",  
		        dataType : 'json',  
		        success : function(res) {
				    //options = eval('(' + res.data + ')');
				    //all_options = options.value;
		        	//alert("success");
					//insert_graph_types(all_options)
		        	window.open("/patents/graphpatentslist.html");
		        	
				}
			});
			//alert(f_graph_message);
		}
	  function drawGraph_7002() {
			/*$.ajaxSetup({async:false});

			var figdata;
			$.get("/draw/graph/7002",function(data,status){figdata = data;});*/

			$.ajax({
				type : 'GET',
				url : '/draw/graph/7002',
				//data : jsonda,
				cache: false,
				async:false,
				//contentType: "application/json; charset=utf-8",
				dataType : 'json',
				success : function(data,status) {
					figdata = data.graph_7002_heatMapResult;
				},
				error : function(xml, err, throwInfo) {
					//alert("数据为空或数据错误");
				}
				});
			
			myChart.clear();
		    
			data1=['邮件营销','联盟广告','视频广告','直接访问','搜索引擎'];
			ylabel=['锂离子电池','石墨烯','高性能存储器','铝热剂','电极','半导体探针','蓄电元件','非水电解液','电池包','固体电解质'];
			ylabel1=['锂离子电池','石墨烯','高性能存储器','铝热剂','电极'];
			ylabel2=['半导体探针','蓄电元件','非水电解液','电池包','固体电解质'];
			thr=2;
			thr1="";
			data2= [];
			data2= figdata.result.xlabel;
			/*ydata1= [];
			ydata1= figdata.value1;
			ydata2= [];
			ydata2= figdata.value2;
			ydata3= [];
			ydata3= figdata.value3;
			ydata4= [];
			ydata4= figdata.value4;
			ydata5= [];
			ydata5= figdata.value5;*/
			
			var ydata = new Array()
			//maxvaluecount=6;
			/*var maxvaluecount=1;
			for(var n=1;n<9999;n++){
				eval("b = value"+n);
				alert(figdata.hasOwnProperty("value1"));
				if((b in figdata))
					maxvaluecount++;
				else
					break;
			}*/
			
		    var labelpre= "value";
		    var existlabelcount=1;
		    var existlabel=labelpre+existlabelcount.toString();
		    while(figdata.result.hasOwnProperty(existlabel)){
		    	existlabelcount++;
		    	existlabel=labelpre+existlabelcount.toString();
		    }

		    maxvaluecount=existlabelcount-1;
		    fixthetop = new Array();
		    var initfl=0.00;

		    if(existlabelcount==1){
		    	initk = figdata.result.xlabel.length;
			    for(var v=0;v<initk;v++){
			    	fixthetop[v]=initfl;
			    }
		    }else{
		    	initk = figdata.result.value1.length;
			    for(var v=0;v<initk;v++){
			    	fixthetop[v]=initfl;
			    }
		    }
		    
		    
		    
			for(i=0;i<maxvaluecount;i++){
				//alert(i);
				ydata[i] = new Array();
				tmp=i+1;
				/*eval("m = figdata.value"+tmp+"["+j+"]")
				if(m!=null){					
				eval("k = figdata.value"+tmp+".length");
				}else{
					eval("k = figdata.value1.length");
				}*/
				eval("k = figdata.result.value"+tmp+".length");
				for(j=0;j<k;j++){
					var t;
					eval("t = figdata.result.value"+tmp+"["+j+"]")
					/*if(t!=null){
						ydata[i][j] = t;
					}else{
						ydata[i][j] = 0; 
					}*/
					if(i==(maxvaluecount-1)){
						if(fixthetop[j]>=1){
							ydata[i][j] = (0).toString();
						}else{
							ydata[i][j] = (1-fixthetop[j]).toString();
						}
						//ydata[i][j] = (1-fixthetop[j]).toString();
					}else{
						ydata[i][j] = t;
						fixthetop[j] = fixthetop[j]+parseFloat(t);
						//alert(parseFloat(t)+" array: "+fixthetop[j]);
					}
					//ydata[i][j] = t;
				}
				
			}
			//alert("hahaha");
			//hotword9=['1','','yes','','','',''];
			hotwordnull='';
			//alert("hahaha");
			/*hotlabelcolor=['#558ED5','#AA4643','#89A544','#71588F','#32cd32','#4198AF','#DB843D','#93A9CF','#D19392','#50B050',      
				'#1e90ff','#ff6347','#7b68ee','#00fa9a','#da70d6',          
				'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];*/
			
			hotlabelcolor=['#558ED5','#AA4643','#89A544','#71588F',
	    '#4198AF','#8B4513','#93A9CF','#D19392','#00B050','#A99BBD','#BD9FBD',
	            '#32cd32','#40e0d0','#3398DB','#ba55d3',
	            '#FF4500','#ff69b4','#cd5c5c','#6495ed',
	            '#1e90ff','#ff6347','#7b68ee','#00fa9a','#da70d6',
	            '#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];//,'#ffd700','#ffa500'
			
			var graphLableMaxLength=6;
			var graphLable1 = new Array();
			var graphLable2 = new Array();
			var graphLablecount=0;
			for(var i=0;i<figdata.result.graphLable.length;i++){
				if(i<figdata.result.graphLable.length/2){
					graphLable1[graphLablecount]=figdata.result.graphLable[i];
					graphLablecount++;
				}else if(i==figdata.result.graphLable.length/2){
					graphLablecount=0;
					graphLable2[graphLablecount]=figdata.result.graphLable[i];
					graphLablecount++;
				}else
				{
					graphLable2[graphLablecount]=figdata.result.graphLable[i];
					graphLablecount++;
				}
			}
			
			//alert(figdata.graphLable);
			option = {
					backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
				        offset: 0,
				        color: '#f7f8fa'
				    }, {
				        offset: 1,
				        color: '#cdd0d5'
				    }]),
			    title: {
			        text: ''//'热点图'
			    },
			    tooltip : {
			        trigger: 'axis',
			        axisPointer: {
			            type: 'cross',
			            label: {
			                backgroundColor: '#6a7985'
			            }
			        }
			    },
			    /*legend: {
			        data: figdata.graphLable,
			        formatter: function (name) {
		                return (name.length > 4 ? (name.slice(0,4)+"...") : name ); 
		            },
			    },*/
			    legend: [
			        {
			            x:'center',
			            //data: figdata.graphLable,
			            data: graphLable1,
				        formatter: function (name) {
			                return (name.length > graphLableMaxLength ? (name.slice(0,graphLableMaxLength)+"...") : name ); 
			            },
			        },
			        {
			            x:'center',
			            top:'3%',
			            //data: figdata.graphLable,
			            data: graphLable2,
				        formatter: function (name) {
			                return (name.length > graphLableMaxLength ? (name.slice(0,graphLableMaxLength)+"...") : name ); 
			            },
			        }],
			  /*  legend: {
			        data:"sdasdasd",
			        top:'10%',
			        left:'10%',
			        orient: 'vertical'
			    },*/
			    toolbox: {
			        feature: {
			            saveAsImage: {}
			        }
			    },
			    grid: {
			        left: '5%',
			        right: '5%',
			        bottom: '5%',
			        top: '10%'
			        //containLabel: true
			    },
			    xAxis : [
			        {
			            type : 'category',
			            name :'年份',
			            boundaryGap : false,
			            data : data2
			        }
			    ],
			    yAxis : [
			        {
			            type : 'value',
			            name :'百分比',
			            nameGap : 10,
			            axisLabel: {  
		                    interval: 0,  
		                    formatter:function(value)  
		                    {  
		                    	var per = value*100;
		                        return per+"%";  
		                    }  
		                },
		                max: 1
			        }
			    ],
			    series : [
			        /*{
			            name: figdata.graphLable[0],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            areaStyle: {normal: {
			                color:'	#E1FFFF',
			            }},
			            itemStyle : {  
			                       normal : {  
			                           color:'#AFEEEE', 
			                  lineStyle:{  
			                      color:'	#AFEEEE'  
			                          }  
			                                }  
			                            }, 
			            data:ydata[0] //ydata1
			        },
			        {
			            name:figdata.graphLable[1],      
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[1]//ydata2
			        },
			        {
			            name:figdata.graphLable[2],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[2]//ydata3
			        },
			        {
			            name:figdata.graphLable[3],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[3]//ydata4
			        },
			        {
			            name:figdata.graphLable[4],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[4]//ydata4
			        },
			        {
			            name:figdata.graphLable[5],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[5]//ydata4
			        },
			        {
			            name:figdata.graphLable[6],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[6]//ydata4
			        },
			        {
			            name:figdata.graphLable[7],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[7]//ydata4
			        },
			        {
			            name:figdata.graphLable[8],
			            type:'line',
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[8]//ydata4
			        },
			        {
			            name:figdata.graphLable[9],
			            type:'line',
			            stack: '总量',
			            
			            label: {
			                normal: {
			                    formatter: function (obj) {
			                        if(hotword9[obj.dataIndex]!==null)
			                        return hotword9[obj.dataIndex];
			                        else return hotwordnull;
			                    },
			                    show: true,
			                    position: 'insideTop',//文字显示位置,如上图中的1.0,1.1字样
			                    textStyle: {
			                        fontSize: '24',
			                        fontWeight: 'normal'
			                    }
			                },
			                emphasis: {
			                    //show: true,
			                    position: 'insideTop',
			                    textStyle: {
			                        fontSize: '24',
			                        fontWeight: 'normal'
			                    }
			                }
			            },
			            areaStyle: {normal: {}},
			            data: ydata[9]//ydata5
			        }*/
			    ]
			};

			
			//alert(maxvaluecount);
			for(i=0;i<maxvaluecount;i++){
				var additem={
			            name:figdata.result.graphLable[i],
			            type:'line',
			            smooth :true,
			            stack: '总量',
			            areaStyle: {normal: {}},
			            data: ydata[i]//ydata4
			        };
				option.series.push(additem);
			}
			/*xaxis=['10%','80%'];
		    yaxis=['20%','80%'];
		    hotlabel=['第一个','第二个'];*/
		    var maxlimit=20;
		    if(figdata.result.hasOwnProperty("yaxis")){
		    	maxlimit=figdata.result.yaxis.length;
		    }else{
		    	maxlimit=0;
		    }
		    
		    //alert(maxlimit);
			var xaxis= new Array();
		    //xaxis= figdata.xaxis;
			if(figdata.result.hasOwnProperty("xaxis")){
				k = figdata.result.xaxis.length;
				//alert("yes");
		    }else{
		    	k=0;
		    }
		    
		    //alert("循环");
		    if(k>maxlimit) k=maxlimit;
		    for(var i=0;i<k;i++){
		    	var t;
		    	//alert("进入循环"+i+"k:"+k);
				//eval("t = figdata.xaxis["+i+"]。toString()");
		    	//alert(figdata.xaxis[0]);
		    	xaxis[i]=(figdata.result.xaxis[i]*100).toString()+"%";
		    	//alert(xaxis[i]+" k: "+k+" i: "+i);
		    }  
		   
		    var yaxis= new Array();
		    //yaxis= figdata.yaxis;
		    
		    
		    if(figdata.result.hasOwnProperty("yaxis")){
		    	k = figdata.result.yaxis.length;
		    }else{
		    	k=0;
		    }
		    
		    var visualthresholdmax=0.92;
		    var visualthresholdmin=0.13;
		    if(k>maxlimit) k=maxlimit;
		    for(var j=0;j<k;j++){
		    	/*yaxis[j]=(yaxis[j]*100).ToString+"%";
		    	alert(yaxis[j]);*/
		    	var t;

		   	 if(parseFloat(figdata.result.yaxis[j])>=visualthresholdmax){
		   		 yaxis[j]=(visualthresholdmax*100).toString()+"%";
		   	 }
		   	 else if(parseFloat(figdata.result.yaxis[j])<=visualthresholdmin){
		   		 yaxis[j]=(visualthresholdmin*100).toString()+"%";
		   	 }else{
		   		yaxis[j]=(figdata.result.yaxis[j]*100).toString()+"%";
		   	 }
		    	
		    	//alert(yaxis[j]+" k: "+k+" j: "+j);
		    } 
		    
		    /*hotlabel= [];
		    hotlabel= figdata.hotlabel;*/
		    
		    var hotlabel= new Array();
		    //yaxis= figdata.yaxis;
		    
		    if(figdata.result.hasOwnProperty("hotlabel")){
		    	k = figdata.result.hotlabel.length;
		    }else{
		    	k=0;
		    }
		    
		    if(k>maxlimit) k=maxlimit;
		    for(var j=0;j<k;j++){
		    	/*yaxis[j]=(yaxis[j]*100).ToString+"%";
		    	alert(yaxis[j]);*/
		    	var t;
		    	hotlabel[j]=figdata.result.hotlabel[j];
		    	//alert(hotlabel[j]+" j: "+k+" j: "+j);
		    } 
		    //alert(hotlabel);
		    //alert(xaxis);
		    //alert(yaxis);
		    
		    hotlabelcolor=['#558ED5','#AA4643','#89A544','#71588F',
	    '#4198AF','#8B4513','#93A9CF','#D19392','#00B050','#A99BBD','#BD9FBD',
	            '#32cd32','#40e0d0','#3398DB','#ba55d3',
	            '#FF4500','#ff69b4','#cd5c5c','#6495ed',
	            '#1e90ff','#ff6347','#7b68ee','#00fa9a','#da70d6',
	            '#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];//#ff6666,'#ffa500'
		 var r=0;
		 for(var i=0;i<k;i++){
			 while(hotlabel[i]=="#"){
				 r++;
				 i++;
			 }
			 if(r>=20){
				 r=0;
			 }
			 //var r=i%20;
		   	 var add2={
			             type:'line',
			             markPoint: {
			                 symbol: 'pin',  
			                 symbolSize: 20,  
			                 itemStyle:{  
			                     normal:{
			                    	 color: hotlabelcolor[r],
			                         borderColor: 'rgba(0,0,0,0)',
			                         borderWidth: 1,  
			                         label:{  
			                                 show: true,  
			                                 position: 'right', 
			                                 textStyle: {
			         	                        fontSize: 16,
			         	                       color: hotlabelcolor[r],//'#FFFFFF'//hotlabelcolor[r],
			         	                    },
			                                 formatter: function (param) {  
			                                 if (param.value == 1)  
			                                     return param.value;  
			                                 else  
			                                    return param.value;  
			                                } ,
			                                //fontSize: 30,
			                               },	                               
			                             },
			                         /*    animationDelay: function (idx) {
			                                   return idx * 300;
			                               },*/
			                 },  

			                 data: [
			                     {
			                         name: hotlabel[i],
			                         show: true,
			                         //coord: ['2013/5/31', 2300],
			                      
			                         x:xaxis[i],
			                         y:yaxis[i],
			                         value: hotlabel[i],
			                         itemStyle: {
			                             //normal: {color: 'rgb(41,60,85)'}
			                         }
			                     },
			                    /* {
			                         //name: 'XX标点',
			                         show: true,
			                         //coord: ['2013/5/31', 2300],
			                         x:xaxis[i],
			                         y:yaxis[i],
			                         value: hotlabel[i],
			                         itemStyle: {
			                             //normal: {color: 'rgb(41,60,85)'}
			                         }
			                     },*/
			                   
			                 ],
			             },
			         }
			     option.series.push(add2);
		    }
		    //alert("zuihou");
		 myChart.on('click', function (param){ 
		        if(param.componentType=="markPoint" && param.name!=""){
		        		//var name=param.name; 
			            //var value=figdata.ylabel[param.value[1]];
			            
			            //window.open('https://www.baidu.com/');
						 //window.location.href="https://www.baidu.com/";
						 //parent.location.href="https://www.baidu.com/";
						 //top.location.href="https://www.baidu.com/";	 
			            //location.href="/search/form.html?key1="+param.name;
		        	//alert(param.name);
		        	//先画的线，再画点，因此点的index要减去所有线的数量
		        	var graphLableLength=figdata.result.graphLable.length;
		        	var markPointIndex=parseInt(param.seriesIndex)-parseInt(graphLableLength);
		        	//alert(markPointIndex);
		        	post_for_patentid_callback_heatmap(figdata.patentsFromWord[markPointIndex]);
		        	}else{
		        		var isContain=0;
		        		for(var i=0;i<figdata.result.xlabel.length;i++){
		        			if(param.name==figdata.result.xlabel[i]){
		        				isContain=1;
		        			}
		        		}
		        		if(isContain==1){
		        			//alert(param.seriesIndex);
		        			post_for_patentid_callback_heatmap(figdata.patentsFromSeries[param.seriesIndex]);
		        		}
		        	}
		             	                                
		        });
			myChart.setOption(option);
			}
		
		function post_for_patentid_callback_heatmap(f_graph_message) {
			$.ajax({
				type : 'POST',  
				url : '/draw/graph/7002_callback', 
				//traditional:true,
				data : {
					'graph_message':JSON.stringify(f_graph_message), 
					//'graph_message':f_graph_message,
					'graph_type': "fishbone"
				},
		        contentType: "application/x-www-form-urlencoded",  
		        dataType : 'json',  
		        success : function(res) {
				    //options = eval('(' + res.data + ')');
				    //all_options = options.value;
		        	//alert("success");
					//insert_graph_types(all_options)
		        	//alert(JSON.stringify(f_graph_message));
		        	window.open("/patents/graphpatentslist.html");
		        	
				}
			});
			//alert(f_graph_message);
		}  
		function drawGraph_7003() {
			  myChart.clear();
			/*var xAxisData = [];
			var data1 = [];
			var data2 = [];
			for (var i = 0; i < 100; i++) {
			    xAxisData.push('类目' + i);
			    data1.push((Math.sin(i / 5) * (i / 5 -10) + i / 6) * 5);
			    data2.push((Math.cos(i / 5) * (i / 5 -10) + i / 6) * 5);
			}*/
		/**
			 *ajax获取相应的数据 鱼骨图
			 */
			
			dataX = [];
			valueY = [];
			comment = [];
			$.ajax({
			type : 'GET',
			url : '/draw/graph/7003',
			//data : jsonda,
			cache: false,
			async:false,
			//contentType: "application/json; charset=utf-8",
			dataType : 'json',
			success : function(res) {
				fishData = res.graph_7003_fishResult;
				//dataX = res.x;
				//comment = res.y;
				//mydata =res.size;
			},
			error : function(xml, err, throwInfo) {
				//alert("数据为空或数据错误");
			}
			});
			/*var s= "yValue";
		   
			
			if(mydata.hasOwnProperty(s))
		       alert("存在");
			else
				alert("不存在");*/
			
			var TagList= new Array();
			TagList=fishData.tagList;
			
			var LineList= new Array();
			LineList = fishData.lineList;
			
			
			var CircleList= new Array();
			CircleList = fishData.circleList;
			
			var PolygonList= new Array();
			PolygonList = fishData.polygonList;
			//alert("多边形起点："+PolygonList[0].pointList[0]);
			
			var Xmax;
			//alert(fishData.polygonList);
			Xmax=fishData.xmax;
			//Xmax=eval("("+Xmax+")");
			//alert("Xmax："+fishData.xmax);
			
			var XendPoint;
			//XendPoint=fishData.boneEndPoint;
			XendPoint=0.0;
			//alert(XendPoint);
			var XendPointValue=parseFloat(XendPoint);
			eval("k = fishData.lineList.length");
		    for(var i=0;i<k;i++){   	
		    	var svalue=parseFloat(LineList[i].startPoint[0]);
		    	var evalue=parseFloat(LineList[i].endPoint[0]);
		    	
		    	if(svalue>XendPointValue){
		    		XendPoint=LineList[i].startPoint[0];
		    	}
		        if(evalue>XendPointValue){
		    		XendPoint=LineList[i].endPoint[0];
		    	}		
		    }
		    //XendPoint=fishData.boneEndPoint;
			//alert(XendPointValue);
			option = {
					backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
				        offset: 0,
				        color: '#f7f8fa'
				    }, {
				        offset: 1,
				        color: '#cdd0d5'
				    }]),
				    title: {
				        text: ''//'鱼骨图',
				    },
				   /* tooltip : {
				        trigger: 'axis',
				        axisPointer: {
				            type: 'cross',
				            label: {
				                backgroundColor: '#6a7985'
				            }
				        }
				    },*/
				    /*legend: {
				        data:['k线均值']
				    },*/
				    toolbox: {
				        feature: {
				            saveAsImage: {},
				            /*dataZoom:{},
				            restore:{}*/
				        }
				    },
			/*	    grid: {
				        left: '5%',
				        right: '5%',
				        bottom: '5%',
				        top: '10%',
				        //containLabel: true
				    },*/
				    xAxis : [
				        {
				            type : 'value',
				            boundaryGap : false,
				            //data : ['周一','周二','周三','周四','周五','周六','周日']
				            min:-20,
				            max:Xmax,
				            //max:Xmax,
				            //show : false,
				            show:false
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value',
				            min:-25,
				            max:25,
				            //show : false,
				            show:false
				        }
				    ],
				    series:[
		/*		    	{
				            name:'视频广告',
				            type:'line',
				            stack: '总量',
				            areaStyle: {normal: {}},
				            data:[150, 232, 201, 154, 190, 330, 410]
				        },*/
				    ]
				};
				 //data1=[1,2,3,4,5];
				 //data2=[3,4,7,6,5];
			    hotlabelcolor=['#32cd32','#40e0d0','#3398DB','#ba55d3',
				'#FF4500','#ff69b4','#cd5c5c','#6495ed',       
				'#1e90ff','#ff6347','#7b68ee','#00fa9a','#da70d6',          
				'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];//,'#ffa500'
			    
			     /*var addMainBone={
			             name:'k线均值',
			             type:'line',
			             stack: '总量',
			             areaStyle: {normal: {}},
			             //data:[120, 132, 101, 134, 90, 230, 210],
			             markLine:{
			                 lineStyle:
			                 {
			                    normal:
			                    {
			                        type:'solid',
			                     
			                    }
			                 },
			                 data:
			                 [
			                     [
			                        {
			                            name: '鱼骨主架',
			                            coord: [0, 500],
			                            label:
			                            {
			                                normal:
			                                {
			                                    position:'start'
			                                }
			                            },
			                            symbol: 'diamond',
			                            symbolRotate:180,
			                            symbolSize: 30,
			                            lineStyle:
			                            {
			                                normal:
			                                {
			                                    width:5,
			                                    color:'red'//hotlabelcolor[12]
			                                }
			                            }
			                        },
			                        {
			                            coord: [1000, 500],
			                            symbol: 'arrow',
			                            symbolSize: 60
			                        }
			                    ],
			                 ],
			                     
			             }             
			         };
			     option.series.push(addMainBone);*/
			     //add line
			     eval("k = fishData.lineList.length");
			     //alert("linelength"+fishData.lineList.length);
			     for(var i=0;i<k;i++){
			     	/*yaxis[j]=(yaxis[j]*100).ToString+"%";
			     	alert(yaxis[j]);*/
			     	//var t;
			     	//hotlabel[j]=figdata.hotlabel[j];
			     	//alert(hotlabel[j]+" j: "+k+" j: "+j);
			     }
			     //LineList[0].color="#3398DB";
			     //alert(fishData.lineList.length);
			    
			     
			     for(var i=0;i<k;i++){
			    	 var LineColor="#3398DB";
			    	 //alert("start:"+LineList[i].startPoint+" "+LineList[i].endPoint+"");
			    	 if(i==0){
			    		 if(LineList[i].color!=""){
					        	LineColor=LineList[i].color;
					        }else{
					        	LineColor="#3398DB";
					        } 
			    		 var addLine={
					             name:'k线均值',
					             type:'line',
					             stack: '总量',
					             areaStyle: {normal: {}},
					             //data:[120, 132, 101, 134, 90, 230, 210],
					             markLine:{
					            	 //silent:true,
					                 lineStyle:
					                 {
					                    normal:
					                    {
					                        type:'solid',
					                     
					                    }
					                 },
					                 data:
					                 [
					                     [
					                        {
					                            //name: '鱼刺1',
					                            coord: LineList[i].startPoint,
					                            label:
					                            {
					                                normal:
					                                {
					                                    position:'end'
					                                }
					                            },
					                            symbol: 'diamond',
					                            symbolSize: 1,
					                            lineStyle:
					                            {
					                                normal:
					                                {
					                                    width:LineList[i].width,
					                                    color:LineColor//LineList[i].color
					                                }
					                            }
					                            
					                        },
					                        {
					                            coord: LineList[i].endPoint,
					                            symbol: 'diamond',
					                            symbolSize: 1,
					                            label:
					                            {
					                                normal:
					                                {
					                                    position:'end'
					                                }
					                            }
					                        }
					                    ],
					                 ],
					                     
					             }
					             
					         };
			    		 
			    	 }else{
			    		 if(LineList[i].color!=""){
					        	LineColor=LineList[i].color;
					        }else{
					        	LineColor="#FF4500";
					        }
			    		 var addLine={
					             name:'k线均值',
					             type:'line',
					             stack: '总量',
					             areaStyle: {normal: {}},
					             //data:[120, 132, 101, 134, 90, 230, 210],
					             markLine:{
					            	 //silent:true,
					                 lineStyle:
					                 {
					                    normal:
					                    {
					                        type:'solid',
					                     
					                    }
					                 },
					                 data:
					                 [
					                     [
					                        {
					                            //name: '鱼刺1',
					                            coord: LineList[i].startPoint,
					                            label:
					                            {
					                                normal:
					                                {
					                                    position:'end'
					                                }
					                            },
					                            symbol: 'diamond',
					                            symbolSize: 1,
					                            lineStyle:
					                            {
					                                normal:
					                                {
					                                    width:LineList[i].width,
					                                    color:LineColor//LineList[i].color
					                                }
					                            }
					                            
					                        },
					                        {
					                            coord: LineList[i].endPoint,
					                            symbol: 'diamond',
					                            symbolSize: 1,
					                            label:
					                            {
					                                normal:
					                                {
					                                    position:'end'
					                                }
					                            }
					                        }
					                    ],
					                 ],
					                     
					             }
					             
					         };
			    	 }        
			     
			       
			     option.series.push(addLine);
			     };
			     
			 	    //option.series.push(addfishhead);
			/*alert(fishData.circleList.length);
			alert(fishData.tagList.length);*/
			     //add ponit
			     eval("k = fishData.tagList.length");
			     //alert("linelength"+fishData.tagList.length);
			     for(var i=0;i<k;i++){
			     	//yaxis[j]=(yaxis[j]*100).ToString+"%";
			     	//alert(yaxis[j]);
			     	//var t;
			     	//hotlabel[j]=figdata.hotlabel[j];
			     	//alert(hotlabel[j]+" j: "+k+" j: "+j);
			     }
			     
			     for(var i=0;i<k;i++){
			    	 /*if(TagList[i].text!=="二级节点1")
			    		 continue;
			    	 else{
			    		 TagList[i].text="二级节点1长度为八";
			    	 }*/
			    	 if(i==0){
			    		 dis=50;
			    	 }
			    	 else{
			    		 dis=5;
			    	 }
		            	 resposition="right";
		            	 switch(TagList[i].direction){
		            	 case "L":
		            		 resposition="left";
		            		 break;
		            	 case "R":
		            		 resposition="right";
		            		 break;
		            	 case "U":
		            		 resposition="top";
		            		 break;
		            	 case "D":
		            		 resposition="bottom";
		            		 break;
		            	 }
			    	 if(i==0){
			    		 circleRadius=1;
			    	 }
			    	 else{
			    		 circleRadius=CircleList[i-1].radius;
			    	 }
			    	 
			    	 if(i==0){
			    		 var fishheadx=PolygonList[0].pointList[0][0];
			 		 	var fishheady=PolygonList[0].pointList[0][1];

			 		 	//var addfishhead={
			 		 	
			 		 	
			 		 	var addTag={
					             type:'line',
				             //stack: '总量',
				             //areaStyle: {normal: {}},
					             markPoint: {
					                 //symbol: 'circle',  
					                 symbolSize: 100,
					                 itemStyle:{  
					                     normal:{
					                    	 color: hotlabelcolor[0],
					                         borderColor: 'rgba(0,0,0,0)',
					                         borderWidth: 1,  
					                         label:{  
					                                 show: true,  
					                                 //position: 'insideLeft', 
					                                 position: resposition, 
					                                 //position: 'inside', 
					                                 //distance: dis,
					                                 textStyle: {
					         	                        fontSize: TagList[i].size,
					         	                       color: 'black',
					         	                    },
					         	                   formatter: function (param) {  
						                                 
					                                	 params=param.value;
					                                	 var newParamsName = "";
					                                	    var paramsNameNumber = params.length;
					                                	    var provideNumber = 6;
					                                	    var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
					                                	    //
					                                	    var start=0;
					                                	    var end=0;
					                                	    if (paramsNameNumber > provideNumber) {
					                                	        /** 循环每一行,p表示行 */
					                                	        for (var p = 0; p < rowNumber; p++) {
					                                	            var tempStr = "";
					                                	            //var start = p * provideNumber;// start point
					                                	            var start = end;// start point
					                                	            var end = start + provideNumber;// end point
					                                	            // attention, deal with the last row
					                                	            //deal with brackets
					                                	            var leftBracketpos=params.substring(start, end).indexOf("(");
					                                	            var rightBracketpos=params.substring(start, end).indexOf(")");
					                                	            if(leftBracketpos>=0 && rightBracketpos<0){
					                                	            	end=params.indexOf(")")+1;
					                                	            	if(end==params.length ){
					                                	            		rowNumber--;
					                                	            	}
					                                	            }
					                                	            //deal with brackets
					                                	            if (p == rowNumber - 1) {

					                                	                tempStr = params.substring(start, paramsNameNumber);
					                                	            } else {
					                                	             
					                                	                tempStr = params.substring(start, end) + "\n";
					                                	                
					                                	            }
					                                	            
					                                	            	newParamsName += tempStr;// result
					                                	            
					                                	            
					                                	            
					                                	        }

					                                	    } else {
					                                	        newParamsName = params;
					                                	    }
					                                	    return newParamsName;
					                                	    /*if (param.value == 1)  
						                                     return param.value;  
						                                 else  
						                                    return param.value; */ 
					                                	    
					                                },
					                                
					                                
					                               },	                               
					                             },
					                 },  

					                 data: [
					                     {   
					                         name: TagList[i].text,//'tag',//TagList[i].text,
					                         show: true,
					                         //coord: ['2013/5/31', 2300],
					                      
					                         //x:500,
					                         //y:800,
					                         //coord: [TagList[i].x, TagList[i].y],
					                         coord:[fishheadx,fishheady],
					                         symbol:'image://',//'image:/static/img/plus.png',//'triangle',
					                         value: TagList[i].text,
					                         itemStyle: {
					                             //normal: {color: 'rgb(41,60,85)'}
					                         }
					                     },
					                   
					                 ],
					             },
				};
			    	 }else{
			    		 var addTag={
					             type:'line',
				             //stack: '总量',
				             //areaStyle: {normal: {}},
					             markPoint: {
					                 symbol: 'circle',  
					                 symbolSize: circleRadius,  
					                 itemStyle:{  
					                     normal:{
					                    	 color: hotlabelcolor[0],
					                         borderColor: 'rgba(0,0,0,0)',
					                         borderWidth: 1,  
					                         label:{  
					                                 show: true,  
					                                 //position: 'insideLeft', 
					                                 position: resposition, 
					                                 //position: 'inside', 
					                                 distance: dis,
					                                 textStyle: {
					         	                        fontSize: TagList[i].size,
					         	                       color: 'black',
					         	                    },
					         	                   formatter: function (param) {  
						                                 
					                                	 params=param.value;
					                                	 var newParamsName = "";
					                                	    var paramsNameNumber = params.length;
					                                	    var provideNumber = 6;
					                                	    var rowNumber = Math.ceil(paramsNameNumber / provideNumber);
					                                	    //
					                                	    var start=0;
					                                	    var end=0;
					                                	    if (paramsNameNumber > provideNumber) {
					                                	        /** 循环每一行,p表示行 */
					                                	        for (var p = 0; p < rowNumber; p++) {
					                                	            var tempStr = "";
					                                	            //var start = p * provideNumber;// start point
					                                	            var start = end;// start point
					                                	            var end = start + provideNumber;// end point
					                                	            // attention, deal with the last row
					                                	            //deal with brackets
					                                	            var leftBracketpos=params.substring(start, end).indexOf("(");
					                                	            var rightBracketpos=params.substring(start, end).indexOf(")");
					                                	            if(leftBracketpos>=0 && rightBracketpos<0){
					                                	            	end=params.indexOf(")")+1;
					                                	            	if(end==params.length ){
					                                	            		rowNumber--;
					                                	            	}
					                                	            }
					                                	            //deal with brackets
					                                	            if (p == rowNumber - 1) {

					                                	                tempStr = params.substring(start, paramsNameNumber);
					                                	            } else {
					                                	             
					                                	                tempStr = params.substring(start, end) + "\n";
					                                	                
					                                	            }
					                                	            
					                                	            	newParamsName += tempStr;// result
					                                	            
					                                	            
					                                	            
					                                	        }

					                                	    } else {
					                                	        newParamsName = params;
					                                	    }
					                                	    return newParamsName;
					                                	    /*if (param.value == 1)  
						                                     return param.value;  
						                                 else  
						                                    return param.value; */ 
					                                	    
					                                },
					                                
					                                
					                               },	                               
					                             },
					                 },  

					                 data: [
					                     {   
					                         name: TagList[i].text,//'tag',//TagList[i].text,
					                         show: true,
					                         //coord: ['2013/5/31', 2300],
					                      
					                         //x:500,
					                         //y:800,
					                         coord: [TagList[i].x, TagList[i].y],
					                         value: TagList[i].text,
					                         itemStyle: {
					                             //normal: {color: 'rgb(41,60,85)'}
					                         }
					                     },
					                   
					                 ],
					             },
				};
			    	 }
			     
			     option.series.push(addTag);
			     //alert(i+":"+TagList[i].text);
			     };
			     
			     //add circle
			     eval("k = fishData.circleList.length");
//			     alert("linelength"+fishData.tagList.length);
			     for(var i=0;i<k;i++){

			     }
			     var circleEnable=0;
			     if(circleEnable==1){
			     for(var i=0;i<k;i++){
			     var addCircle={
			             type:'line',
		             //stack: '总量',
		             //areaStyle: {normal: {}},
			             markPoint: {
			                 symbol: 'circle',  
			                 symbolSize: CircleList[i].radius,  
			                 itemStyle:{  
			                     normal:{
			                    	 color: hotlabelcolor[0],
			                         borderColor: 'rgba(0,0,0,0)',
			                         borderWidth: 1,  
			                         label:{  
			                                 show: true,  
			                                 position: 'inside', 
			                                 textStyle: {
			         	                        fontSize: 16,
			         	                       color: hotlabelcolor[6],
			         	                    },
			                                 formatter: function (param) {  
			                                 if (param.value == 1)  
			                                     return param.value;  
			                                 else  
			                                    return param.value;  
			                                } ,
			                               },	                               
			                             },
			                 },  

			                 data: [
			                     {
			                         //name: 'XX标点',
			                         show: true,
			                         //coord: ['2013/5/31', 2300],
			                      
			                         /*x:500,
			                         y:800,*/
			                         coord: [CircleList[i].x, CircleList[i].y],
			                         value: '',
			                         itemStyle: {
			                             //normal: {color: 'rgb(41,60,85)'}
			                         }
			                     },
			                   
			                 ],
			             },
		};
			     
			     option.series.push(addCircle);
		};
		}
		//add polygon
		//eval("k = fishData.polygonList.length");
		/*for(var i=0;i<k;i++){
		}*/

		//original fish head
		//for(var i=1;i<k;i++){
		//ignore fishhead, and draw it later. ignore fishtail, and draw it later
		//alert(PolygonList[0].pointList[0]+","+PolygonList[0].pointList[1]);
		/*for(var i=2;i<k;i++){
		  
			var PolygonListitem= new Array();
			PolygonListitem = PolygonList[i].pointList;
			eval("m = PolygonListitem.length");
			for(var j=0;j<m;j++){
				
				if(j<(m-1)){
					var startPoint=PolygonListitem[j];
				  	var endPoint=PolygonListitem[j+1];
				}else{
					var startPoint=PolygonListitem[j];
				  	var endPoint=PolygonListitem[0];
				}
				
				var addpolygon={
				        name:'k线均值',
				        type:'line',
				        stack: '总量',
				        areaStyle: {normal: {}},
				        //data:[120, 132, 101, 134, 90, 230, 210],
				        markLine:{
				            lineStyle:
				            {
				               normal:
				               {
				                   type:'solid',
				                
				               }
				            },
				            data:
				            [
				                [
				                   {
				                       //name: '鱼刺1',
				                       coord: startPoint,
				                       label:
				                       {
				                           normal:
				                           {
				                               position:'end'
				                           }
				                       },
				                       symbol: 'diamond',
				                       symbolSize: 1,
				                       lineStyle:
				                       {
				                           normal:
				                           {
				                               width:LineList[i].width,
				                               color:hotlabelcolor[3]
				                           }
				                       }
				                       
				                   },
				                   {
				                       coord: endPoint,
				                       symbol: 'diamond',
				                       symbolSize: 1,
				                       label:
				                       {
				                           normal:
				                           {
				                               position:'end'
				                           }
				                       }
				                   }
				               ],
				            ],
				                
				        }
				        
				    };
				option.series.push(addpolygon);

			}
			
			
			
			
		};*/
		
			 
		    var addfishtail={
		            //name:'scatter1',
		            type:'line',
		            //symbol: 'emptyCircle', //'circle', 'rectangle', 'triangle', 'diamond', 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond'


		            markPoint : {
		                symbolSize: 50,
		                itemStyle: {
		                normal: {
		                    color: hotlabelcolor[3],
		                    borderColor: hotlabelcolor[3],
		                    borderWidth: 0,
		                    label : {show: false}
		                },
		                emphasis: {
		                    color: 'lightgreen',
		                }
		            },
		            silent:true,
		                data : [
		                    {//type : 'min', 
		                    name: 'x最小值', 
		                    /*coord:[0,0], 
		                    symbolRotate:180,*/
		                    coord:[XendPoint,0], 
		                    //symbolRotate:0,
		                    symbol:'image://',//'triangle',
		                    itemStyle:{normal:{borderColor:hotlabelcolor[3]}}}
		                ]
		            },
		     
		        };
		        option.series.push(addfishtail);
		    
			     //for 循环
			     /*xaxis=['10%','80%'];
			     yaxis=['20%','80%'];
			     hotlabel=['第一个','第二个'];
			     hotlabelcolor=['#3398DB','#32cd32','#da70d6','#ff6666','#6495ed',
						'#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0',       
						'#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',          
						'#6699FF','#87cefa','#3cb371','#b8860b','#30e0e0'];
			     
			     for(var i=0;i<xaxis.length;i++){
			    	 var r=i%20;
			    	 var add2={
				             type:'line',
				             markPoint: {
				                 symbol: 'pin',  
				                 symbolSize: 1,  
				                 itemStyle:{  
				                     normal:{
				                         color: hotlabelcolor[r],
				                         borderColor: 'rgba(0,0,0,0)',
				                         borderWidth: 1,  
				                         label:{  
				                                 show: true,  
				                                 position: 'inside', 
				                                 textStyle: {
				         	                        fontSize: 20,
				         	                       color: hotlabelcolor[r],
				         	                    },
				                                 formatter: function (param) {  
				                                
				                                     return param.value;  
				                                
				                                 }
				                               }
				                             }  
				                 },  
				                 data: [
				                     {
				                         //name: 'XX标点',
				                         show: true,
				                         //coord: ['2013/5/31', 2300],
				                      
				                         x:xaxis[i],
				                         y:yaxis[i],
				                         value: hotlabel[i],
				                         itemStyle: {
				                             //normal: {color: 'rgb(41,60,85)'}
				                         }
				                     },
				                     {
				                         //name: 'XX标点',
				                         show: true,
				                         //coord: ['2013/5/31', 2300],
				                         x:xaxis[i],
				                         y:yaxis[i],
				                         value: hotlabel[i],
				                         itemStyle: {
				                             //normal: {color: 'rgb(41,60,85)'}
				                         }
				                     },
				                   
				                 ],
				             },
				         }
				     option.series.push(add2);
			     }*/
			     
			     
			     //option.title.text='堆叠区域图';
		        /*myChart.on('click', function (param){  
		            var name=param.name; 
		            var value=figdata.ylabel[param.value[1]];
		            var xindex=param.dataIndex;
		            var yindex=param.seriesIndex;
		            var indexXY="send"+xindex+yindex;
		            post_for_patentid_callback(indexXY);            
		        });*/
		        
		        myChart.on('click', function (param){  
			        if(param.componentType=="markPoint" && param.name!=""){
			        		//var name=param.name; 
				            //var value=figdata.ylabel[param.value[1]];
				            
				            //window.open('https://www.baidu.com/');
							 //window.location.href="https://www.baidu.com/";
							 //parent.location.href="https://www.baidu.com/";
							 //top.location.href="https://www.baidu.com/";	 
				            //location.href="/search/form.html?key1="+param.name;
			        	//alert(param.name);
			        	//先画的线，再画点，因此点的index要减去所有线的数量
			        	var lineListLength=fishData.lineList.length;
			        	var markPointIndex=parseInt(param.seriesIndex)-parseInt(lineListLength);
			        	post_for_patentid_callback_fishbone(TagList[markPointIndex].patentList);
			        	}
			             	                                
			        });
		       
		        
		        
				 myChart.setOption(option);
			}
		function post_for_patentid_callback_fishbone(f_graph_message) {
			$.ajax({
				type : 'POST',  
				url : '/draw/graph/7002_callback', 
				//traditional:true,
				data : {
					'graph_message':JSON.stringify(f_graph_message), 
					//'graph_message':f_graph_message,
					'graph_type': "fishbone"
				},
		        contentType: "application/x-www-form-urlencoded",  
		        dataType : 'json',  
		        success : function(res) {
				    //options = eval('(' + res.data + ')');
				    //all_options = options.value;
		        	//alert("success");
					//insert_graph_types(all_options)
		        	//alert(JSON.stringify(f_graph_message));
		        	window.open("/patents/graphpatentslist.html");
		        	
				}
			});
			//alert(f_graph_message);
		}
});
